<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/index.xhtml">
        <ui:define name="title"/>
        <h:outputText value="#{bundle.ListTblPerfilTitle}"></h:outputText>
        <ui:define name="body">

            <h:form styleClass="jsfcrud_list_form">

                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>

                <p:dataTable id="tbl" var="item" value="#{tblPerfilController.items}"
                             paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
                             paginator="true" rows="10" style="margin-bottom:20px; border:solid 1px">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListTblPerfilTitle_codPerfil}"/>
                        </f:facet>
                        <h:outputText value="#{item.codPerfil}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListTblPerfilTitle_nombrePerfil}"/>
                        </f:facet>
                        <h:outputText value="#{item.nombrePerfil}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListTblPerfilTitle_descripcion}"/>
                        </f:facet>
                        <h:outputText value="#{item.descripcion}"/>
                    </h:column>

                    <p:column>
                        <p:growl id="messages" /> 
                        <p:splitButton value="#{bundle.ListTblPerfilViewLink}" action="#{tblPerfilController.prepareView}" update="messages" icon="ui-icon-disk"> 
                            <p:menuitem value="#{bundle.ListTblPerfilEditLink}" action="#{tblPerfilController.prepareEdit}" ajax="false" icon="ui-icon-close" />
                            <p:menuitem value="#{bundle.ListTblPerfilDestroyLink}" action="#{tblPerfilController.destroy}" ajax="false" icon="ui-icon-close" />
                        </p:splitButton>
                    </p:column>

                </p:dataTable>
                </h:panelGroup>
                <br />
                <p:commandButton action="#{tblPerfilController.prepareCreate}" value="#{bundle.ListTblPerfilCreateLink}"/>

            </h:form>
        </ui:define>
    </ui:composition>

</html>
